package com.jcf.springboot.controller.business;

import com.jcf.springboot.common.R;
import com.jcf.springboot.entity.business.Member;
import com.jcf.springboot.service.MemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;

/**
 * @author ${chaofan.ji}
 * @since 2025/6/22
 */
//@RefreshScope
//@RestController
public class FeignController {
  @Value("${order.timeout}")
  String timeout;
  @Autowired
  MemberService memberService;
  @GetMapping("getMemberById")
  public R getMemberById(String id) {

    Member member = memberService.getById(id);
    if (!StringUtils.isEmpty(member)) {
      return R.ok().message("获取会员信息成功").data(member);
    } else {
      return R.error().message("获取会员信息失败");
    }
  }

  @GetMapping("config")
  public String getConifg(String id) {
    return timeout;

  }
}
